//引入所有图标
import * as Icons from '@ant-design/icons';
import React from "react";

const LoadIcon: React.FC<{ name: string }> = ({name}) => {
  // 将字符串名字转换为具体的组件
  const IconComponent = (Icons as any)[name];

  if (!IconComponent) {
    // console.error(`Icon '${name}' not found`);
    return null;
  }

  return React.createElement(IconComponent);
}

export default LoadIcon